using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class mg_errorsMap : EntityTypeConfiguration<mg_errors>
    {
        public mg_errorsMap()
        {
            // Primary Key
            this.HasKey(t => t.Test);

            // Properties
            this.Property(t => t.Id)
                .HasMaxLength(6);

            this.Property(t => t.Latin_Name)
                .HasMaxLength(30);

            this.Property(t => t.Test)
                .IsRequired()
                .HasMaxLength(84);

            // Table & Column Mappings
            this.ToTable("mg_errors");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.CASE__).HasColumnName("CASE_#");
            this.Property(t => t.Latin_Name).HasColumnName("Latin_Name");
            this.Property(t => t.Test).HasColumnName("Test");
        }
    }
}
